import React from 'react';
import { 
  File, 
  FileText, 
  FileImage, 
  FileVideo, 
  FileAudio, 
  FileArchive,
  Folder,
  FileSpreadsheet,
  FileCode,
  FileType
} from 'lucide-react';

const FileIcon = ({ type, size = 'medium' }) => {
  const getIconSize = () => {
    switch (size) {
      case 'small':
        return 'w-5 h-5';
      case 'large':
        return 'w-12 h-12';
      default:
        return 'w-8 h-8';
    }
  };

  const getIcon = () => {
    const iconSize = getIconSize();
    
    switch (type) {
      case 'folder':
        return <Folder className={`${iconSize} text-blue-500`} />;
      case 'document':
        return <FileText className={`${iconSize} text-blue-600`} />;
      case 'pdf':
        return <FileType className={`${iconSize} text-red-600`} />;
      case 'spreadsheet':
        return <FileSpreadsheet className={`${iconSize} text-green-600`} />;
      case 'presentation':
        return <FileText className={`${iconSize} text-orange-600`} />;
      case 'image':
        return <FileImage className={`${iconSize} text-purple-600`} />;
      case 'video':
        return <FileVideo className={`${iconSize} text-pink-600`} />;
      case 'audio':
        return <FileAudio className={`${iconSize} text-indigo-600`} />;
      case 'archive':
        return <FileArchive className={`${iconSize} text-yellow-600`} />;
      case 'code':
        return <FileCode className={`${iconSize} text-gray-600`} />;
      case 'executable':
        return <File className={`${iconSize} text-red-500`} />;
      case 'figma':
        return <File className={`${iconSize} text-purple-500`} />;
      default:
        return <File className={`${iconSize} text-material-grey-500`} />;
    }
  };

  return (
    <div className="flex items-center justify-center">
      {getIcon()}
    </div>
  );
};

export default FileIcon;
